<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- 1.修饰符：lazy -->
      <!-- 回车之后才会加载出来 -->
      <input type="text" v-model.lazy="message" />
      <h2>{{message}}</h2>

      <!-- 2.修饰符：number -->
      <!-- v-model默认情况下都是赋值string -->
      <input type="number" v-model.number="age" />
      <h2>{{typeof age}}</h2>

      <!-- 3.修饰符 trim 去掉两边多余的空格-->
      <!-- 在浏览器里面看不出来，只有在console里面看 -->
      <input type="text" v-model.trim="name" />
      <h2>您输入的名字是: {{name}}</h2>
    </div>

    <script src="../js/vue.js"></script>

    <script>
      const app = new Vue({
        el: "#app",
        data: {
          message: "你好",
          age: 0,
          name: "",
        },
      });
    </script>
  </body>
</html>
